import 'package:development_assistant/ui/screen/api_assistant/api_assistant.dart';
import 'package:development_assistant/ui/screen/database_assistant/database_assistant.dart';
import 'package:development_assistant/ui/screen/server_assistant/server_assistant.dart';
import 'package:development_assistant/ui/screen/test_assistant/test_assistant.dart';
import 'package:development_assistant/ui/screen/widget/custom_bottom_nav.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class Home extends StatelessWidget {
  const Home({super.key});

  @override
  Widget build(BuildContext context) {
    var selectIndex=0.obs;
    if(Get.arguments!=null){
      selectIndex.value=Get.arguments["selectIndex"];
    }

    changePage(int index){
      selectIndex.value=index;
    }

    final List<Widget> page=[ServerAssistant(),ApiAssistant(),TestAssistant(),DatabaseAssistant()];

    return Scaffold(
      body:Obx(()=>page[selectIndex.value]),
      bottomNavigationBar: CustomBottomNav(
        changePage: (index)=>changePage(index),
      ),
    );
  }
}
